package week04;
import java.util.ArrayList;
import java.util.List;
/** List to array */
public class ToArray {

  public static void main(String[] args) {

    List list = new ArrayList();

    list.add("Blobbo");

    list.add("Cracked");

    list.add("Dumbo");

    Object[] ol = list.toArray();
    System.out.println("Array of Object has length " + ol.length);
    String[] sl = (String[]) list.toArray(new String[0]);
    System.out.println("Array of String has length " + sl.length);
  }
}
